import { defineConfig } from "vite";
import reactRefresh from "@vitejs/plugin-react-refresh";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [reactRefresh()],
  // 兼容webpack导入less的写法，以~开头(@import'~...')
  resolve: {
    alias: [
      {
        find: /^~/,
        replacement: "",
      },
    ],
  },
  // 配置less, less-loader的引入
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
});
